/*
 * ULSF Sagittarius IDA
 * Copyright (C) 2012, John Pritchard, all rights reserved.
 * 
 * This program is free software: you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see
 * <http://www.gnu.org/licenses/>.
 */
package sagittarius.design;

/**
 *
 */
public class ModelCircle
    extends AbstractModel
    implements Model.Sectional
{
    /**
     * Area of the circle section
     */
    public final float radius, area;

    /**
     * {@link Visualization} ordered (Y,Z)+ vertices of the shell in CCW order
     * from top (Y+) to bottom with a shared midpoint and identical
     * endpoints.
     */
    public final float[] vertices;


    public ModelCircle(float radius, float area){
        super();

        this.radius = radius;
        this.area = area;
        this.vertices = this.generateCircle(radius);
    }


    public boolean isPath(){
        return false;
    }
    public boolean isHyperbolic(){
        return false;
    }
    public boolean isSectional(){
        return true;
    }
    public float getSectionalArea(){
        return this.area;
    }
    public float[] getSectionalVertices(){
        return this.vertices.clone();
    }
    public float[] getVerticesFor(float area, float radius){
        if (EEQ(radius,this.radius))
            return this.vertices.clone();
        else
            return this.generateCircle(radius);
    }
}
